﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SmartSapce.ServiceLocation;
using SmartSpace.Core;
using SmartSpace.Web;

namespace SmartSpace.WebApp.Modules.Core.Pickers
{
    public partial class CodePicker : System.Web.UI.Page
    {
        public string Category { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            Category = Request.GetString("category");
            if (!IsPostBack)
            {
                ICoreService service = ServiceLocator.Get<ICoreService>();
                List<CodeDefinition> codes = service.GetCodeDefinitions(Category);
                _ctlListCode.DataSource = codes;
                _ctlListCode.DataBind();
            }
        }
    }
}